package com.nc.mem.serial.graph.common;

import java.nio.ByteBuffer;
import java.util.TimeZone;

import com.nc.mem.serial.graph.GraphSerializer;


public class TimeZoneSerializer extends GraphSerializer {

	public static TimeZoneSerializer INSTANCE = new TimeZoneSerializer();

	@Override
	public void doRead(final ByteBuffer src, final Object obj) {

	}

	@Override
	public void doWrite(final ByteBuffer dest, final Object obj) {
		StringSerializer.INSTANCE.writeNonRoot(dest, ((TimeZone) obj).getID());
	}

	@Override
	public Object instantiate(final ByteBuffer src) {
		return TimeZone.getTimeZone((String) StringSerializer.INSTANCE.readNonRoot(src));
	}

}